package com.vlh.battleship.server.state;

import com.vlh.battleship.server.integration.dto.Player;
import com.vlh.battleship.server.integration.dto.board.EmptyTile;
import com.vlh.battleship.server.integration.dto.board.Tile;
import com.vlh.battleship.server.integration.dto.game.Game;

public class GameHandler {

	public Game createGame(int lenX, int lenY, Player challenger, Player challenged) {
		Game g = new Game();
		g.setChallenger(challenger);
		g.setChallenged(challenged);
		g.setTurn(challenged);
		for (int i = 0; i < lenY; i++)  {
			for (int j = 0; j < lenX; j++) {
				Tile t = new EmptyTile();
				t.setYPos(i);
				t.setXPos(j);
				g.getTiles().add(t);
			}
		}
		return g;
	}
	
}
